package com.zb.Service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zb.Service.CardorderService;
import com.zb.entity.Cardorder;
import com.zb.mapper.CardorderMapper;


@Component("CardorderService")
public class CardorderServiceImpl implements CardorderService{
	@Autowired
	private CardorderMapper cm;
	public int getMaxId() {
		
		return cm.getMaxId();
	}

	public void savecard(int userid, int deptid, String ordertime,
			String phone, String tel, int count, String content, int roleid) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("userid", userid);
		params.put("deptid", deptid);
		params.put("ordertime", ordertime);
		params.put("phone", phone);
		params.put("tel", tel);
		params.put("count", count);
		params.put("content", content);
		params.put("roleid", roleid);
		cm.savecard(params);
		
	}

	public Cardorder getCardById(int id) {
		
		return cm.getCardById(id);
	}

}